﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace DriverLicence.Cnsl.Entities
{
    public class Question
    {
        public string Statement { get; set; }
        public IAnswer[] Options { get; set; }

        public void RandomSort()
        {
            var rnd = new Random();
            this.Options = this.Options.OrderBy(x => rnd.Next()).ToArray();
        }

        public IAnswer GetRigthOption()
        {
            return this.Options.First(o => o.IsCorrectAnswer);
        }
    }
}
